package com.jluzh10.learning.domain;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Question {
    private Integer id;

    private Integer userId;

    private Integer courseId;

    private Integer chapterId;

    private String title;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date createTime;

    private Integer replyNum;

    private Integer browseNum;

    private Byte state;

    private int delFlag;//0为不显示删除图标 1为显示删除图标

    private Answer answer;//返回最新的answer

    private User user;//一个问题关联一个用户

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(int delFlag) {
        this.delFlag = delFlag;
    }

    public Answer getAnswer() {
        return answer;
    }

    public void setAnswer(Answer answer) {
        this.answer = answer;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getCourseId() {
        return courseId;
    }

    public void setCourseId(Integer courseId) {
        this.courseId = courseId;
    }

    public Integer getChapterId() {
        return chapterId;
    }

    public void setChapterId(Integer chapterId) {
        this.chapterId = chapterId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getReplyNum() {
        return replyNum;
    }

    public void setReplyNum(Integer replyNum) {
        this.replyNum = replyNum;
    }

    public Integer getBrowseNum() {
        return browseNum;
    }

    public void setBrowseNum(Integer browseNum) {
        this.browseNum = browseNum;
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "Question{" +
                "id=" + id +
                ", userId=" + userId +
                ", courseId=" + courseId +
                ", chapterId=" + chapterId +
                ", title='" + title + '\'' +
                ", createTime=" + createTime +
                ", replyNum=" + replyNum +
                ", browseNum=" + browseNum +
                ", state=" + state +
                ", delFlag=" + delFlag +
                ", answer=" + answer +
                ", user=" + user +
                '}';
    }
}